import PyServer
class ServerTask:
	def msgParse(self,taskc,content):
		print "msgParse",content
		taskc.sendString("haha")
	
class Server(PyServer.PyServerDelegate):
	def goInit(self):
		self.init(6007)
		self.registerTask(ServerTask)

class ClientTask:
	def msgParse(self,taskc,content):
		print("ClientTask::msgParse",content)
	def addOkay(self,taskc):
		taskc.sendString("hello")

class Client(PyServer.PyClientDelegate):
	def goInit(self):
		self.registerTask(ClientTask)
		self.init("127.0.0.1",6007)

server = Server("Server")
server.goInit()

client =  Client()
client.goInit()
server.addClient(client)

server.start()



